package com.wit.zhyl.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    public static Result ok(String requestId){
        return new Result(200,"ok", null);
    }
    public static Result ok(Object data){
        return new Result(200, "ok", data);
    }
    public static Result ok(List<?> data){
        return new Result(200, "ok", data);
    }
    public static Result fail(Integer code, String errorMsg, Object data){
        return new Result(code, errorMsg, data);
    }
}
